home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / Freeware / DiskMaster / Rexx / DMTextSearch.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2002-10-27  |  798 b   |  37 lines

  1. /* $VER: DMTxtSearch.rexx 1.0 (11.10.98) by J. Tierney
  2.  
  3.   DiskMaster II Text Search  v1.0
  4.   10/11/98  J. Tierney
  5.  
  6.   Purpose:  Searches selected files for a string pattern.
  7.             If no files are selected then all the files in the directory are
  8.            searched.
  9.             Subdirectories are not searched.
  10.  
  11.   Usage:  DMStr
  12. */
  13.  
  14. OPTIONS RESULTS
  15.  
  16. 'CONFIRM "Find Text" Search Cancel " "'
  17. IF rc ~= 0 THEN EXIT 0
  18. ptrn = result
  19.  
  20. 'STATUS P'
  21. srcpath = result
  22. IF RIGHT(srcpath, 1) ~= ':' THEN srcpath = srcpath || '/'
  23.  
  24. DIRLIST SEL FILE
  25.  
  26. IF list.name.0 = 0 THEN DO
  27.   /* Set the entire source dir to be searched. */
  28.   DIRLIST FILE
  29. END
  30.  
  31. DESELECT '*'
  32.  
  33. DO i = 1 TO list.name.0
  34.   ADDRESS COMMAND 'Search >NIL: FROM' srcpath || list.name.i 'SEARCH' ptrn 'PATTERN'
  35.   IF rc = 0 THEN 'SELECT' list.name.i
  36. END
  37.